<template>
  <view>
    <view class="content" v-html="text">

    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        text: '',
        info: {
          type: ''
        }
      };
    },
    onLoad(option) {
      this.info.type = option.type
      if (this.info.type == 1) {
        uni.setNavigationBarTitle({
          title: "隐私政策"
        })
      }
      if (this.info.type == 2) {
        uni.setNavigationBarTitle({
          title: "服务协议"
        })
      }
      this.getAgreement()
    },
    methods: {
      async getAgreement() {
        const {
          data: res
        } = await uni.$http.post('school/login/getAgreement', this.info)
        if (res.code != 1) {
          this.toast.msg(res.msg)
          return
        }
        this.text = res.data
      }
    }
  }
</script>

<style lang="scss">
  .content {
    padding: 0 30rpx;
  }
</style>